#include "RenderData.h"
#include "RenderComponent.h"
const AssetType RenderData::m_RenderDataType = "RenderData";


bool RenderData::Restore()
{
	return true;
}
bool RenderData::Release()
{
	return true;
}

ActorComponentPtr RenderData::CreateComponent(ActorPtr Owner)
{
	ActorComponentPtr cmp(RE_NEW MeshRenderComponent);
	MeshRenderComponent * meshcmp = dynamic_cast<MeshRenderComponent*>(cmp.get());
	
	meshcmp->m_pOwner = Owner.get();
	meshcmp->m_pMesh = m_Mesh;
	meshcmp->m_pMaterial = m_pMaterial;

	EventManager::Get()->VTriggerEvent(EventDataPtr(RE_NEW EventData_NewActorComponent(cmp)));
	return cmp;
}